package view.normalview;


import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Map;

import javax.swing.*;

import view.interfaces.Iview;

import Model.interfaces.Iassociation;
import Model.interfaces.Idiagrame;

public class finalReport extends JPanel implements Iview {
	JTable jt;
	
String report[][];
  String fields[] = {"usecas", "class", "function"};

  public finalReport( Idiagrame dia ) {
   addDiagram(dia);
	  jt = new JTable( report, fields );
    JScrollPane pane = new JScrollPane( jt );
    
    add(pane);
  }



@Override
public void addDiagram(Idiagrame diagram) {
	report=new String[diagram.listAssociation().size()][3];
	int i=0;
	for(Map.Entry<String, Iassociation> ass : diagram.listAssociation().entrySet()){
		report[i][0]=ass.getValue().getLower().getName();
		report[i][1]=ass.getValue().getupper().getName();
		report[i][2]=ass.getValue().getFunctionality();
		i++;
	}
	
	
	
}

@Override
public void convert() {
	// TODO Auto-generated method stub
	
}

@Override
public String getCode() {
	// TODO Auto-generated method stub
	return null;
}
}

